package com.dsbj.mp.icardservice.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 部门Bean
 *
 * @author evan 2017-09-28
 * @version 1.0
 */
@Data
@TableName("H_P_DEPT")
public class Dept extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 1965208029618675159L;

	private String companyno; // 公司编号

	@TableId(value = "id", type = IdType.UUID)
	private String id; //GUID主键
	private String parentId; // 上级主键ID
	private String deptno;// 部门编号
	private String deptname; // 部门名称
	private Integer labortype; // 0为DL 一线部门,1为IDL 辅助岗位部门
	private Integer outside; // 0为内部，1为外部

	@TableField(value = "FIRST_ID")
	private String firstid;//一级部门
	private Integer updateflag; //同步状态
	private Integer noattendance;//不纳入考勤(1:不纳入 ;0:纳入)
	private Integer nosalary;//不纳入薪资(1:不纳入;0:纳入)

	private String firstdeptno; //一级部门编号
	private String firstdeptname; //一级部门名称
	private String seconddeptno; //二级部门编号
	private String seconddeptname; //二级部门名称
	private String thirddeptno; //三级部门编号
	private String thirddeptname; //三级部门名称
	private String fourthdeptno; //四级部门编号
	private String fourthdeptname; //四级部门名称
	private String fifthdeptno; //五级部门编号
	private String fifthdeptname; //五级部门名称

	//自定义

	@TableField(exist = false)
	@JSONField(serialize = false)
	private Boolean isChildren;

	@TableField(exist = false)
	private String parentName;

	@TableField(exist = false)
	private String firstname; //一级部门名称

	@TableField(exist = false)
	private String[] notIncosteptno; //成本中心选择部门   已选过的不显示

	@TableField(exist = false)
	private String[] deptnos;

	@TableField(exist = false)
	private String[] inworkovertimedlimit;

	@TableField(exist = false)
	private String[] workovertimedlimit;

	@TableField(exist = false)
	private String[] deptnames;

	@TableField(exist = false)
	private String[] ids;

	@TableField(exist = false)
	private String deptnoDim; //模糊查询

	@TableField(exist = false)
	public static final List<String> COLUMN_HEAD = new ArrayList<String>();

	@TableField(exist = false)
	public static final Map<Integer, Integer> COLUMN_WIDTH = new LinkedHashMap<Integer, Integer>(12);

	static {
		COLUMN_WIDTH.put(0, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(1, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(2, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(3, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(4, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(5, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(6, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(7, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(8, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(9, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(10, (int) ((1000 * 20) / 3.57));
		COLUMN_WIDTH.put(11, (int) ((1000 * 20) / 3.57));

		COLUMN_HEAD.add("部门编号");
		COLUMN_HEAD.add("部门名称");
		COLUMN_HEAD.add("一级部门编码");
		COLUMN_HEAD.add("一级部门名称");
		COLUMN_HEAD.add("二级部门编码");
		COLUMN_HEAD.add("二级部门名称");
		COLUMN_HEAD.add("三级部门编码");
		COLUMN_HEAD.add("三级部门名称");
		COLUMN_HEAD.add("四级部门编码");
		COLUMN_HEAD.add("四级部门名称");
		COLUMN_HEAD.add("五级部门编码");
		COLUMN_HEAD.add("五级部门名称");
	}


	public String gettext() {
		return getDeptno() + "-" + getDeptname();
	}

}
